package com.ccb.sc.common.modules.live.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @version 1.0
 * @date 2022-07-30 21:48
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum LiveStreamingOrderStatus implements IEnum<Integer> {

    /**
     * 未完成
     */
    UN_FINISHED(0, "未完成"),

    /**
     * 已完成
     */
    FINISHED(1, "已完成");

    private int value;
    private String desc;

    LiveStreamingOrderStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static LiveStreamingOrderStatus getByValue(int value) {
        for (LiveStreamingOrderStatus liveStreamingOrderStatus : LiveStreamingOrderStatus.values()) {
            if (liveStreamingOrderStatus.getValue() == value) {
                return liveStreamingOrderStatus;
            }
        }
        return null;
    }
}
